package cn.gjculture.shopping.api.dao;

import cn.gjculture.shopping.api.entity.JiangRecord;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface JiangRecordDao {

    @Insert("insert into jiangrecord(scoreRecordId,customerId,scoreUse,`desc`,scoreSurPlus,useTime,orderId) " +
            "values(#{scoreRecordId},#{customerId},#{scoreUse},#{desc},#{scoreSurPlus},#{useTime},#{orderId})")
    int insert(JiangRecord scoreRecord);

    @Select("select * from jiangrecord order by useTime  desc")
    List<JiangRecord> query();
    @Select("select * from jiangrecord where customerId=#{customerId} order by useTime  desc")
    List<JiangRecord> queryByCustomerId(String customerId);
}
